body {
  margin: 0;
}

.main {
  width: 100%;
  height: 600px;
  padding: 20px;
}

.topnav {
  overflow: hidden;
  background-color: black;
}

.topnav a {
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  transition: all .5s;
}

.topnav a:hover {
  background-color: rgba(255, 0, 0, .3);
}

.topnav .icon {
  display: none;
}

@media screen and (max-width: 600px) {
  .topnav a:not(:first-child) {
    display: none;
  }

  .topnav a.icon {
    float: right;
    display: block;
  }
}

@media screen and (max-width: 600px) {
  .topnav.responsive {
    position: relative;
  }

  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
    color: white;
  }

  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }

}